<?php
class sfWidgetFormSchemaFormatterEmcms extends sfWidgetFormSchemaFormatter
{
    protected $rowFormat                 = '<div class="form_row"><div class="label">%label%</div> %error% <div class="form-field">%field% %help%</div> %hidden_fields%</div>';
    protected $errorRowFormat            = '<div class="error">%errors%</div>';
    protected $errorListFormatInARow     = '<div class="error_list error">%errors%</div>';
    protected $errorRowFormatInARow      = '%error%';
    protected $namedErrorRowFormatInARow = '%name%: %error%';
    protected $helpFormat                = '<div class="form-help"><em>%help%</em></div>';
    protected $decoratorFormat           = '<div>%content%</div>';

    public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null)
    {
        $row = parent::formatRow(
                $label,
                $field,
                $errors,
                $help,
                $hiddenFields
        );
        return strtr($row, array(
            '%row_class%' => (count($errors) > 0) ? ' form_row error' : 'form_row'
            ));
  }

}
